package com.game.data;

import com.dats.entity.BaseGroup;
import com.dats.entity.BaseGroup2;
import com.dats.entity.BaseObj;
import com.dats.entity.CacheBean;
import com.dats.hot.HotSwapI;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * @author sig
 * @since 2016/9/25
 */
public interface DataI extends HotSwapI {
    <T extends BaseObj> T getBase(Class<T> clazz, int id);

    <T extends BaseObj> List<T> getBaseList(Class<T> clazz);

    <T extends BaseObj> List<Integer> getBaseIdList(Class<T> clazz);

    <T extends BaseObj> Map<Integer, T> getBaseMap(Class<T> clazz);

    <T extends BaseGroup> List<T> getBaseGroup(Class<T> clazz, int groupId);

    <T extends BaseGroup2> List<T> getBaseGroup2(Class<T> clazz, int groupId2);

    <T extends CacheBean> T loadBeanByValue(Class<T> clazz, long value);

    <T extends CacheBean> List<T> loadBeanList(Class<T> clazz);

    <T extends CacheBean> List<T> loadBeanList(Class<T> clazz, String sql);

    <T extends CacheBean> void saveBean(T t);

    <T extends CacheBean> void saveBeanList(Collection<? extends T> list);
}
